package com.ruoyi.manage.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.EmpContractMapper;
import com.ruoyi.manage.domain.EmpContract;
import com.ruoyi.manage.service.IEmpContractService;

/**
 * 员工合同Service业务层处理
 * 
 * @author cf
 * @date 2025-06-04
 */
@Service
public class EmpContractServiceImpl implements IEmpContractService 
{
    @Autowired
    private EmpContractMapper empContractMapper;

    /**
     * 查询员工合同
     * 
     * @param empContractId 员工合同主键
     * @return 员工合同
     */
    @Override
    public EmpContract selectEmpContractByEmpContractId(Long empContractId)
    {
        return empContractMapper.selectEmpContractByEmpContractId(empContractId);
    }

    /**
     * @return
     */
    @Override
    public List<Map<String, Object>> countStaffBySignDateMonth() {
        return empContractMapper.countStaffBySignDateMonth();
    }


    /**
     * 查询员工合同列表
     * 
     * @param empContract 员工合同
     * @return 员工合同
     */
    @Override
    public List<EmpContract> selectEmpContractList(EmpContract empContract)
    {
        return empContractMapper.selectEmpContractList(empContract);
    }

    /**
     * 新增员工合同
     * 
     * @param empContract 员工合同
     * @return 结果
     */
    @Override
    public int insertEmpContract(EmpContract empContract)
    {
        empContract.setCreateTime(DateUtils.getNowDate());
        return empContractMapper.insertEmpContract(empContract);
    }

    /**
     * 修改员工合同
     * 
     * @param empContract 员工合同
     * @return 结果
     */
    @Override
    public int updateEmpContract(EmpContract empContract)
    {
        empContract.setUpdateTime(DateUtils.getNowDate());
        return empContractMapper.updateEmpContract(empContract);
    }

    /**
     * 批量删除员工合同
     * 
     * @param empContractIds 需要删除的员工合同主键
     * @return 结果
     */
    @Override
    public int deleteEmpContractByEmpContractIds(Long[] empContractIds)
    {
        return empContractMapper.deleteEmpContractByEmpContractIds(empContractIds);
    }

    /**
     * 删除员工合同信息
     * 
     * @param empContractId 员工合同主键
     * @return 结果
     */
    @Override
    public int deleteEmpContractByEmpContractId(Long empContractId)
    {
        return empContractMapper.deleteEmpContractByEmpContractId(empContractId);
    }
}
